package com.junbao.message.domain.enums;

public enum NotifyStatus {

	WAIT_NOTIFY(5,"待通知"),
	WAIT_CONFIRM(10,"待确认"),
	CONFIRMING(12,"确认中"),
	WAIT_SEND(15,"待发送"),
	SENDING(20,"发送中"),
	SENDED(30,"已发送"),
	SUCCESS(40,"已消费"),
	FAIL(50,"失败");
	
	private Integer code;
	
	private String message;
	
	NotifyStatus(Integer code,String message){
		this.code = code;
		this.message = message;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public static NotifyStatus getNotifyStatusByCode(int code){
		switch (code) {
		case 5:
			return WAIT_NOTIFY;
		case 10:
			return WAIT_CONFIRM;
		case 12:
			return CONFIRMING;
		case 15:
			return WAIT_SEND;
		case 20:
			return SENDING;
		case 30:
			return SENDED;
		case 40:
			return SUCCESS;
		case 50:
			return FAIL;
		}
		return null;
	}
	
}
